<?php

namespace app\admin\validate;

use think\Validate;

class User extends Validate
{

    protected $rule = [
        'account' => 'require|alphaNum',
        'nickname' => 'require|chsDash',
        'sex' => 'require|number',
        'password' => 'require',
        'password2' => 'require|confirm:password',
        'email' => 'require|email',
        'tel' => 'require',
        'phone' => 'require',
        'status' => 'require|number',
        'sort'=>'require|number'
    ];


    protected $scene = [
        'add' => [
            'account',
            'nickname',
            'sex',
            'password',
            'password2',
            'email',
            'tel',
            'phone',
            'sort',
            'status',
        ],
        'update' => [
            'account',
            'nickname',
            'sex',
            'email',
            'tel',
            'phone',
            'sort',
            'status',
        ]
    ];
}